package xyz.zhzby.cyzx.acl.service;

import com.alibaba.fastjson.JSONObject;
import xyz.zhzby.cyzx.acl.entity.Permission;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.zhzby.cyzx.servicebase.domain.RestResponse;

import java.util.List;

/**
 * <p>
 * 权限表 服务类
 * </p>
 *
 * @author zby
 * @since 2021-12-07
 */
public interface IPermissionService extends IService<Permission> {

    //获取全部菜单
    RestResponse<List<Permission>> queryAllMenu();

    //根据角色获取菜单
    RestResponse<List<Permission>> selectAllMenu(Long roleId);

    //给角色分配权限
    void saveRolePermissionRealtionShip(Long roleId, Long[] permissionId);

    //根据用户id获取用户菜单
    List<String> selectPermissionValueByUserId(Long id);

    List<JSONObject> selectPermissionByUserId(Long id);

    RestResponse<String> saveOne(Permission permission);

    RestResponse<String> updateOne(Permission permission);

    RestResponse<String> removePermissionById(Long permissionId);
}
